﻿namespace _9_属性;

internal class Person
{
    private string name;
    private string occupation;

    public Person(string name, string occupation)
    {
        this.name = name;
        this.occupation = occupation;
    }

    // getter: 获取属性值, 7.0 之前
    // setter: 设置属性值, 7.0 之前

    //public string Name
    //{
    //    get { return name; }
    //    set { name = value; }
    //}
    //public string Occupation
    //{
    //    get { return occupation; }
    //    set { occupation = value; }
    //}

    // getter: 获取属性值, 7.0 之后
    // setter: 设置属性值, 7.0 之后

    //public string Name
    //{
    //    get => name;
    //    set => name = value;
    //}

    //public string Occupation
    //{
    //    get => occupation;
    //    set => occupation = value;
    //}
}

internal class Program
{
    private static void Main(string[] args)
    {
        Console.WriteLine("Hello, World!");
    }
}